package com.vone.ui;

import java.awt.Color;
import java.awt.Cursor;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JLabel;

/**
 * 自定义页码按钮PageJLabel（<<,<,跳转,>>,>）
 * 
 * @author admin
 *
 */
public class MyPageJLabel extends JLabel {

	private static final long serialVersionUID = 1L;
	private String equalsValue = "";// 用于对比的值 存放用于比较判断的值

	public MyPageJLabel(String text, int horizontalAlignment) {
		super(text, horizontalAlignment);

		this.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseExited(MouseEvent e) {// 鼠标移出事件
				setCursor(Cursor.getDefaultCursor());// 鼠标变成手型
				setBackground(new Color(255, 255, 255));
				setOpaque(true);
				setForeground(new Color(88,88,88));
			}

			@Override
			public void mouseEntered(MouseEvent e) {// 鼠标移入事件
				setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));// 鼠标变回默认
				setBackground(new Color(39,157,227));
				setOpaque(true);
				setForeground(new Color(255, 255, 255));
			}
		});
	}

	public String getEqualsValue() {
		return equalsValue;
	}

	public void setEqualsValue(String equalsValue) {
		this.equalsValue = equalsValue;
	}
}